package com.example.sbbsec.fjhelper;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;


/**
 * Created by Arat.Wu on 2018/12/17.
 */
@Aspect
@Component
public class DeserializeAspect {

    // 可以被重复利用
    @Pointcut(value = "@annotation(com.example.sbbsec.fjhelper.annotion.FastJsonHelper)")
    private void pointcut() {
    }

    @Around(value = "pointcut()")
    public Object exec(ProceedingJoinPoint invocation) throws Throwable {
        try {
            return invocation.proceed();
        }finally {
            FastJsonHelper.remove();
        }

    }

}
